package com.yuanlrc.base.entity.admin;


import com.yuanlrc.base.annotion.ValidateEntity;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.Table;

/**
 * 学院列表实体类
 *
 */
@Entity
@Table(name="ylrc_faculties")
@EntityListeners(AuditingEntityListener.class)
public class Faculties extends BaseEntity {

    // 学院编号 学院名称 学院地址 学院负责人 负责人电话 学院介绍
    @ValidateEntity(required=true,requiredLeng=true,minLength=2,maxLength=2,errorRequiredMsg="学院编号不能为空!",errorMinLengthMsg="学院编号只能写两位!",errorMaxLengthMsg="学院编号只能写两位!")
    @Column(name="num",nullable=false,length=2)
    private String num;    //编号

    @ValidateEntity(required=true,requiredLeng=true,minLength=2,maxLength=10,errorRequiredMsg="学院名称不能为空!",errorMinLengthMsg="学院名称至少填写两个!",errorMaxLengthMsg="学院名称最多填写十个!")
    @Column(name="name",nullable=false,length=10)
    private String name;   //名称

    @ValidateEntity(required=true,requiredLeng=true,minLength=2,maxLength=10,errorRequiredMsg="负责人不能为空!",errorMinLengthMsg="负责人名字过短!",errorMaxLengthMsg="负责人名字过长!")
    @Column(name="leader",nullable=false,length=10)
    private String leader;   //负责人

    @ValidateEntity(required=true,requiredLeng=true,minLength=11,maxLength=11,errorRequiredMsg="负责人电话不能为空!",errorMinLengthMsg="请填写11位电话!",errorMaxLengthMsg="请填写11位电话!")
    @Column(name="telephone",nullable=false,length=11)
    private String telephone;   //负责人电话

    @ValidateEntity(required=false)
    @Column(name="address",length=255)
    private String address;   //学院地址

    @ValidateEntity(required=false)
    @Column(name="introduce",length=255)
    private String introduce;   //学院介绍

    public String getNum() {
        return num;
    }

    public void setNum(String num) {
        this.num = num;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getLeader() {
        return leader;
    }

    public void setLeader(String leader) {
        this.leader = leader;
    }

    public String getTelephone() {
        return telephone;
    }

    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getIntroduce() {
        return introduce;
    }

    public void setIntroduce(String introduce) {
        this.introduce = introduce;
    }
}
